﻿@model IEnumerable<CSP.Receipts.DataModel.Receipt>
@if (Model.Count() == 0)
{
    @Html.Partial("NoResults")
}
else
{
<table class="maxWidth interactive">
    <caption>
        Rezeptliste
    </caption>
    <thead>
        <tr>
            <th>Kategorie</th>
            <th style="width: 40%">
                Rezepttitel
            </th>
            <th>
                erstellt am
            </th>
            <th>
                Link
            </th>
        </tr>
                <tr>
            <th colspan="5">
                Zubereitungsauszug
            </th>
        </tr>
    </thead>
    <tbody>
        @foreach (var item in Model)
        {
            <tr>
                <td>@item.Category.Title</td>
                <td>
                    @Html.ActionLink(item.Title, "Details", "Receipts", new {id=item.Id, title=item.Title}, null)
                </td>
                <td>
                    @String.Format("{0:d}", item.CreationDate)
                </td>
                <td>
                    <a href="@item.Url">@item.Url</a>
                </td>
            </tr>
                        <tr >
                <td colspan="5" style="padding-top: 10px; padding-bottom: 10px;">
                    @(item.ReceiptText.Length > 200 ? item.ReceiptText.Substring(0, 200) : item.ReceiptText)
                </td>
            </tr>
        }
    </tbody>
</table>
}